<template>
    <view class="search flex flex-row">
        <view class="searchIpt flex flex-row a-item">
            <view style="width: 30rpx" />
            <icon type="search" size="20"></icon>
            <input style="width: 100%" class="ipt" :placeholder="placeholder" @input="changeVal"  confirm-type="search" type="text"/>
        </view>
    </view>
</template>

<script>
import pub from "../common/pub";

export default {
    props:{
        placeholder:{
            type:String,
            default:'请输入'
        },
    },

    methods:{
        changeVal(e){
            // uniapp自带emit失效??
            this.$emit('change',e.target.value)
            //改用自定义订阅
            // pub.$pub('changeKey',e.target.value)
        }
    }

}
</script>



<style scoped lang="scss">
.search {
  background: #F2F5F8;
  flex: 1;
  border-radius: 77rpx;
  height: 66rpx;
    .searchIpt{
        width: 100%;
    }
    .ipt{
        width: 500rpx;
    }

};

</style>